package finalcase;

public class Cat extends Animal{
    String kind;
    String food;
    public Cat() {
    }

    public Cat(String name,int age,String kind, String food) {
        super(name,age);
        this.kind = kind;
        this.food = food;
    }

    /**
     * 重写父类的方法
     */
    @Override
    public void eat(){
        System.out.println("一只叫"+getName()+"，"+getAge()+"岁的"+kind+",正在吃"+food);
    }

    /**
     * 获取
     * @return kind
     */
    public String getKind() {
        return kind;
    }

    /**
     * 设置
     * @param kind
     */
    public void setKind(String kind) {
        this.kind = kind;
    }

    /**
     * 获取
     * @return food
     */
    public String getFood() {
        return food;
    }

    /**
     * 设置
     * @param food
     */
    public void setFood(String food) {
        this.food = food;
    }

    public String toString() {
        return "Cat{kind = " + kind + ", food = " + food + "}";
    }
}
